home *** CD-ROM | disk | FTP | other *** search
/ Informática Multimedia 1995 April / Informatica Multimedia CD - Epimundo.iso / DOS / ARCHIVE / XTEST.ZIP / ISLHA.BAT < prev    next >
Encoding:
DOS Batch File  |  1994-05-01  |  2.0 KB  |  67 lines

  1. @echo off
  2. goto Start
  3.                            ┌───────────────╖
  4.                            │   ISLHA.BAT   ║
  5.                            ╘═══════════════╝
  6.  
  7.                        Sun  05-01-1994  22:07:52
  8.  
  9.      Uses LHA.EXE's Exit Codes to test to see if a Self Extracting file
  10.      is a LHA file. Kinda cute and interesting.... Led me to make
  11.      LHA_ZIP.BAT which processes all files. This one just processes one
  12.      file as:
  13.  
  14.      COMMAND:              ISLHA  MyFile
  15.                                   (do NOT use the *.EXE extension)
  16.  
  17.      ─────────────────────exit code info from lha213.doc─────────────────
  18.  
  19.       G.  Exit Codes.
  20.       ==============
  21.  
  22.          LHA will return following result codes after batch or other
  23.          processes' execution.
  24.  
  25.          0.  Normal.
  26.  
  27.          1.  CRC error occured, probably with 'e','x','t' commands.
  28.              Or LHA failed to create files because of disk space, or
  29.              because of files in existence.
  30.  
  31.          2.  Fatal error.  Process terminated without transactions.
  32.  
  33.          3.  Failed to write temporary files in the archive.  You may
  34.              find a temporary file LHTEMP)2(.LZH on your working direct
  35.              ory.  You may rename this file with extension LZH, and use
  36.              it as an archive.
  37.  
  38.  
  39.      ───────────────END  exit code info from lha213.doc─────────────────
  40. :Start
  41.  
  42. lha t %1.exe
  43. rem lha t am.exe (test mode)
  44. if errorlevel 3 if not errorlevel 4 goto NoTempFile
  45. if errorlevel 2 if not errorlevel 3 goto NotLHA
  46. if errorlevel 1 if not errorlevel 2 goto NotLHA
  47. if errorlevel 0 if not errorlevel 1 goto Report
  48. goto End
  49. :Report
  50. echo Archived file %1.EXE is a LHA.EXE Archived file >> islha.txt
  51. echo Archived file %1.EXE is a LHA.EXE Archived file
  52. echo 
  53. pause
  54. goto End
  55. :NotLHA
  56. echo Archived file %1.EXE is =NOT= a LHA.EXE archived file >> islha.txt
  57. echo Archived file %1.EXE is =NOT= a LHA.EXE archived file
  58. echo 
  59. pause
  60. goto End
  61. :NoTempFile
  62. echo No temporary file was written, check directory
  63. echo 
  64. pause
  65. goto End
  66. :End
  67.